Skip to content

Fix MCP nested response handling for repo_reader tool#33

Merged
williams21v merged 1 commit intomainfrom
paython-mcp
Dec 3, 2025
Merged

Fix MCP nested response handling for repo_reader tool#33
williams21v merged 1 commit intomainfrom
paython-mcp

Conversation

@PVeazie951
Copy link
Copy Markdown
Contributor

📝 PR DESCRIPTION (Copy/Paste Ready)

Summary

This PR fixes the issue where the front-end could not load GitHub repositories or branches during the “Connect” flow. The root cause was a mismatch between the actual MCP response shape and what the front-end API client expected.

What was happening

The repo_reader MCP tool returns a nested response:
payload.data.data.repositories
But the front-end assumed:
payload.data.repositories
This caused:
• listRepos() to return an empty array
• loadRepos() in Zustand to save empty state
• The UI dropdowns to appear empty even though the backend returned valid data

Fix
• Updated listRepos() and listBranches() to correctly unwrap the nested MCP response
• Ensured full alignment with the backend MCP response format
• Added detailed console logs to the store for future debugging

Impact
• Repository dropdown now correctly populates from GitHub
• Branch dropdown loads as expected
• Connect → Configure flow works end-to-end
• No backend changes required

Testing Steps
1. Connect GitHub via OAuth
2. Click Re-sync Repos
3. Repo dropdown should populate
4. Select a repo → branches should load
5. Confirm logs show valid repo + branch data

Additional Notes

This was a front-end only fix.
Backend MCP logic remains unchanged.

Copy link
Copy Markdown
Contributor

@williams21v williams21v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!!

@williams21v williams21v merged commit 1bc34a3 into main Dec 3, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants